
<link  href="/stylesheets/tests.css" type="text/css" rel="stylesheet" media="screen">
  <style type="text/css" rel="stylesheet">
    form {
        margin: 0;
        }
        .editor {
        margin-top: 5px;
        margin-bottom: 5px;
        }
        .ke-content {
        font-family: Courier New;
        font-size: 12px;
        background-color: #ffffff;
    }

  </style>
   <script type="text/javascript" charset="utf-8" src="/kindeditor/kindeditor.js"></script>
  <script type="text/javascript">
    KE.show({
        id : 'dimen_description',
        resizeMode :1,
        cssPath : '/kindeditor/examples/index.css',
        items : []
    });
  </script>
  
<br/>
<p class="smallNav">
  <%= link_to "专业量表管理", :action => "index"  %>>>
  <%= link_to "编辑量表", :action => "edit", :id => @dimen.survey  %>>>
  编辑维度
</p>

<div style="margin: 15px 0 10px 0">
</div>


<% form_for :dimen, :url => {:action => "update_dimen"} do |f| %>
  <%= hidden_field_tag "id", @dimen.id %>
  <p>
    维度名称:&nbsp;<%= f.text_field :name %>&nbsp;
    <%=link_to '删除' ,:action=>"del_dimen" ,:id=>@dimen.id%>
    <br/><br/>
    description：&nbsp;&nbsp;
    <%=f.text_area :description ,:style=>"width:500px;height:160px;visibility:hidden;"%>
    <br />
    <p>
    报告内容配置：<br />
      是否显示总分：
      <select name="dimen[show_total]" >
       <option value=1 <% if @dimen.show_total == true %> selected="selected" <% end%>>是</option>
       <option value=0 <% if @dimen.show_total == false  %> selected="selected" <% end%>>否</option>
     </select>
    是否显示平均分
    <select name="dimen[show_avg]" >
       <option value=1 <% if @dimen.show_avg == true %> selected="selected" <% end%>>是</option>
       <option value=0 <% if @dimen.show_avg == false  %> selected="selected" <% end%>>否</option>
     </select>
  </p>
  <br/>
  <b>总分加权计算方法：</b><br/>
  <p>
    <%= f.text_field :formula %><br/>
    支持加减乘除运算，加：+ &nbsp;&nbsp;减：－&nbsp;&nbsp;乘：*&nbsp;&nbsp;除：/<br/>
    格式：运算符号 + 数字, &nbsp; <br/><font color="#FF0020">不要输入" /0"(除数为0)  ,  所有字符之间都不能有空格，不要用中文输入法输入<br/></font>
    正确输入如：<br/>
    &nbsp;&nbsp;*1.2<br/>
    &nbsp;&nbsp;/2<br/>
    &nbsp;&nbsp;+20

    <br/><br/>
  </p>
<br /></br>
    该维度包含题目：
  </p>
  <div style="margin: 20px 0 20px 20px">
    <% for question in @questions %>
      <%= check_box_tag "dimen[question_ids][]", question.id, @dimen.questions.include?(question) %>
      第<%= @questions.index(question) + 1 %>题.
      <%= question.description %><br/>
    <% end %>
  </div>
  <%= f.submit "提交" %>
<% end %>

